﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Reg.aspx.cs" Inherits="Reg" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>用户注册</title>
    <link rel="Stylesheet" href="CSS/Validation.css" type="text/css" />
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="js/vanadium.js"></script>
    <script type="text/javascript" src="js/validationfun.js"></script>
    <style type="text/css">
    .btn-dy-blue
{
  font-family:"Arial", "Tahoma", "微软雅黑", "雅黑";
	border:0px;
	vertical-align:middle;
	margin:8px;
	line-height:18px;
	font-size:18px;
	cursor:hand;
	width:101px;
	height:28px;
	line-height:18px;
	font-size:18px;
	background:url("Images/btn2.jpg") no-repeat left top;
	color:#FFF;
	padding-bottom:4px;
}
div{overflow:hidden;}
div.RoundedCorner{background: #ffffff} 
b.rtop, b.rbottom{display:block;background: #005089} 
b.rtop b, b.rbottom b{display:block;height: 1px;overflow: hidden; background:#ffffff} 
b.r1{margin: 0 5px} 
b.r2{margin: 0 3px} 
b.r3{margin: 0 2px} 
b.rtop b.r4, b.rbottom b.r4{margin: 0 1px;height: 2px} 
    </style>
    <script type="text/javascript"> 
function checkLength(){
    var curLength = find("txtIntro").value.length;
    if (curLength>150){
        find("txtIntro").value = find("txtIntro").value.substr(0,150);
        curLength = 150;
    }
	find("textCount").innerHTML = 150-find("txtIntro").value.length;
}
function find(id){
	return document.getElementById(id);
}
window.onload = function(){
	if(/msie/i.test(navigator.userAgent)){
		find("txtIntro").onpropertychange = checkLength;
	} else {
		find("txtIntro").addEventListener("input",checkLength,false);
	}
}
</script>
<script type="text/javascript">
        function checkuser()
        {
           if ($.trim($("#txtTid").val())!=""&&$("#txtTid").val().length>3)
            {
                $.ajax({
                type:"GET",
                url:"Common/CheckUser.ashx",
                dataType:"html",
                data:"userName="+$("#txtTid").val(),
                beforeSend:function(XMLHttpRequest)
                    {
                        $("#showresult").text("正在查询账号....");
                    },
                success:function(msg)
                    {   
                        if (msg=="yes")
                         {
                             $("#showresult").html("该职工号尚未注册，可以注册！");
                             $("#showresult").css("color","green");
                             $("#txtTid").css("border","1px solid green");
                         } 
                       else
                       {
                             $("#showresult").html("该职工号已被注册，请联系管理员核查！");
                             $("#showresult").css("color","#a40000");
                             $("#txtTid").css("border","1px solid #a40000");
                       } 
                    },
               complete:function(XMLHttpRequest,textStatus)
                    {
                        //隐藏正在查询图片
                    },
              error:function()
                   {
                        //错误处理
                   }
                });
           }  
           else
           {
                 $("#showresult").html("输入字符长度不低于<em>4</em>个. 此项不可为空!");
                 $("#showresult").css("color","#a40000");
                 $("#txtTid").css("border","1px solid #a40000");
                return false; 
           }  
    }
 
</script>
</head>
<body style="background:#005089;">
    <form id="form1" runat="server">
    <div>
    <center>
<div class="RoundedCorner" style="background-color:White; width:72%;">
    <b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b> 
        <table border="0" cellpadding="0" cellspacing="0"> 
            <tr>
                <td colspan="3" style="width: 685px; padding:0; margin:0;" rowspan="3">
                  <fieldset>
                <legend>系统信息</legend>&nbsp;
                      <table style="width: 100%; height: 136px" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                              <td style="width: 139px;" align="right" rowspan="2">
                                  申请的角色:</td>
                              <td colspan="3" rowspan="2" align="left" style="width: 742px">
                                  &nbsp;<asp:RadioButton ID="rbUsertype1" runat="server" Checked="True"
                                      GroupName="G1"  Text="教师用户" />
                                  <asp:RadioButton ID="rbUsertype2" runat="server" GroupName="G1"
                                       Text="学院管理员" />
                                  <asp:RadioButton ID="rbUsertype3" runat="server" GroupName="G1"
                                       Text="项目管理员" /><span></span></td>
                              <td align="left" colspan="1" rowspan="5">
                                  <span style="font-size: 9pt; color: #06c; font-family: 宋体"></span></td>
                          </tr>
                          <tr style="font-size: 9.6pt; font-family: 微软雅黑">
                          </tr>
                          <tr style="font-size: 9.6pt; font-family: 微软雅黑">
                              <td style="width: 139px" align="right">
                                  <span style="color: #a40000">*</span>教职工号:</td>
                              <td colspan="3" align="left" style="width: 742px">
                    <input id="txtTid" onblur='checkuser();' runat="server" type="text" class=":requirednotext" /><span id="showresult"></span>
                    </td>
                          </tr>
                          <tr style="font-size: 9.6pt; font-family: 微软雅黑">
                              <td style="width: 139px" align="right">
                                  <span style="color: #a40000">*</span>请请入密码:</td>
                              <td colspan="3" align="left" style="width: 742px">
                    <input id="txtPwd" runat="server"  type="password" class=":required :min_length;4 :max_length;12" /><span
                        style="color: #a40000"></span></td>
                          </tr>
                          <tr style="font-size: 9.6pt; font-family: 微软雅黑">
                              <td style="width: 139px" align="right">
                                  <span style="color: #a40000">*</span>请再次输入密码:</td>
                              <td colspan="3" align="left" style="width: 742px"><input id="txtPwd2" runat="server" type="password" class=":same_as;txtPwd :required" /><span
                                      style="color: #a40000"></span></td>
                          </tr>
                      </table>
        </fieldset>
                <fieldset>
                <legend>个人信息</legend>
         <table border="0" width="100%" cellpadding="0" cellspacing="0" style="margin:0;">
             <tr>
                 <td align="right" style="width: 139px">
                     <span style="color: #a40000">*</span>姓名:</td>
                 <td align="left" colspan="2">
                     <input id="txtName" runat="server" type="text" class=":required" />
                 </td>
                 <td align="left" colspan="1" rowspan="1" style="width: 137px">
                 </td>
             </tr>
            <tr>
                <td style="width: 139px" align="right">
                    <span style="color: #a40000">*</span>性别</td>
                <td align="left" colspan="2">
                     <asp:RadioButton ID="rbSexmale" runat="server" Checked="True" GroupName="G2"
                         Text="男" />
                     <asp:RadioButton ID="rbSexfamale" runat="server" GroupName="G2" Text="女" /></td>
                <td align="left" colspan="1" rowspan="5" style="width: 137px">
                    <img src="Images/finish.png" /><br />
                    <span style="font-size: 9pt; color: #06c; font-family: 宋体">填写尽可能详细的个人资料，以便管理员能尽快通过认证。</span></td>
            </tr>
             <tr>
                 <td style="width: 139px" align="right">
                     <span style="color: #a40000">*</span>所属学院(部门):</td>
                 <td align="left" colspan="2">
                    <asp:DropDownList ID="ddlDepart" runat="server" Height="27px" Width="205px" CssClass=":required">
                    </asp:DropDownList></td>
             </tr>
             <tr>
                 <td style="width: 139px;" align="right">
                     <span style="color: #a40000">*</span>专业:</td>
                 <td align="left" colspan="2">
                     <input id="txtField" runat="server" type="text" class=":required" /></td>
             </tr>
             <tr>
                 <td style="width: 139px" align="right">
                     <span style="color: #a40000">*</span>学历:</td>
                 <td align="left" colspan="2">
                     <select id="sltBg" runat="server" style="width: 205px; height: 27px" class=":required">
                         <option selected="selected"></option>
                         <option value="博士研究生">博士研究生</option>
                         <option value="硕士研究生">硕士研究生</option>
                         <option value="本科">本科</option>
                         <option value="专科">专科</option>
                         <option value="中专">中专</option>
                         <option value="其它">其它</option>
                     </select></td>
             </tr>
             <tr>
                 <td align="right" style="width: 139px">
                     <span style="color: #a40000">*</span>职称:</td>
                 <td align="left" colspan="2">
                     <select id="sltTitle" runat="server" style="width: 205px; height: 27px" class=":required">
                         <option selected="selected"></option>
                         <option value="助教">助教</option>
                         <option value="讲师">讲师</option>
                         <option value="副教授">副教授</option>
                         <option value="教授">教授</option>
                         <option value="技术员">技术员</option>
                         <option value="助理工程师">助理工程师</option>
                         <option value="工程师">工程师</option>
                         <option value="高级工程师">高级工程师</option>
                         <option value="研究实习员">研究实习员</option>
                         <option value="助理研究员">助理研究员</option>
                         <option value="副研究员">副研究员</option>
                         <option value="研究员">研究员</option>
                         <option value="实验员">实验员</option>
                         <option value="助理实验师">助理实验师</option>
                         <option value="实验师">实验师</option>
                         <option value="高级实验师">高级实验师</option>
                         <option value="其它">其它</option>
                     </select></td>
             </tr>
            <tr>
                <td style="width: 139px" align="right">
                    固定电话:</td>
                <td align="left" colspan="3">
                    <input id="txtTelephone" runat="server" type="text" class=":max_length;18" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();"/><span></span></td>
            </tr>
            <tr>
                <td style="width: 139px" align="right">
                    <span style="color: #a40000">*</span>手机:</td>
                <td align="left" colspan="3">
                    <input id="txtCellphone" runat="server" type="text" class=":required :format;/^0{0,1}(13[0-9]|15[0-9]|18[0-9])[0-9]{8}$/"/><span></span></td>
            </tr>
             <tr>
                 <td style="width: 139px" align="right">
                     <span style="color: #a40000">*</span>电子邮箱(e-mail):</td>
                 <td align="left" colspan="3">
                     <input id="txtEmail" runat="server" class=":required :email " type="text" /></td>
             </tr>
             <tr>
                 <td style="width: 139px" align="right">
                     个人简介<span style="font-size: 8pt">(<span id="textCount">150</span>字以内)</span>:</td>
                 <td style="width: 278px" align="left" rowspan="4">
                     <asp:TextBox ID="txtIntro" runat="server" CssClass=":max_length;150" Height="110px"
                         TextMode="MultiLine" Width="267px"></asp:TextBox></td>
                 <td colspan="2">
                 </td>
             </tr>
             <tr>
                 <td style="width: 139px" rowspan="4">
                 </td>
                 <td colspan="2">
                 </td>
             </tr>
             <tr>
                 <td colspan="2">
                 </td>
             </tr>
             <tr>
                 <td colspan="2">
                 </td>
             </tr>
             <tr>
                 <td style="width: 278px">
                 </td>
                 <td style="width: 88px">
                     </td>
                 <td>
                 </td>
             </tr>
        </table>
                    <span style="color: #a40000"> 您的帐户只有经过管理员核实后才能开通使用。如未按期开通，请与管理员联系。<table style="width: 100%;
                        height: 32px">
                        <tr>
                            <td align="center" colspan="3">
                                <asp:Button ID="btnRegister" onmouseover="this.style.backgroundPosition='left -28px'" onmouseout="this.style.backgroundPosition='left top'" runat="server" Text="确认注册" CssClass="btn-dy-blue" OnClick="btnRegister_Click"/></td>
                        </tr>
                    </table>
                    </span>
        </fieldset>
                </td>
            </tr>
            
            <tr>
            </tr>
            <tr>
            </tr>
        </table>
       <b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b> 
        </div>

    </center>
    </div>
    </form>
</body>
</html>
